The invention relates to a method an apparatus for storing data in a tape unit provided with a cache memory method and apparatus for reading data that has been stored in accordance with the present invention from the tape unit.
FIG. 1 shows parts of a computer system that are essential to the invention. A central processing unit CPU is here considered to contain all necessary parts that have not been specifically mentioned, such as a main memory, display unit, keyboard, etc. For the duration of a power failure, the programs and other information are stored in Winchester disk units W1 and W2, two of which are shown in FIG. 1 by way of example. A disk controller, or interface IF, of the computer of FIG. 1 comprises two buses for disk units, one for each disk unit W1 and W2.
Tape units are often used in computer systems to back up storing of data in a disk unit. Data may be stored either for backup copying or for transmission of data to some other place, e.g. from an exchange to an billing centre. Block TU (Tape Unit) in FIG. 1 shows this kind of a tape unit, or tape recorder. In distributed computer systems, often only one computer is provided with a tape unit. The data of the other computers (CPUxe2x80x2) can be stored in the common tape unit via a junction cable C.
Tape units are usually divided into two groups based on the way the tape moves: start/stop tape units and streamer tape units. In the former, the tape is started for writing a data block and stopped after the writing. In streamer tape units, the tape moves basically during the entire backup copying process. In order that the tape could be kept moving even when the computer doing the backup copying performs some other functions, tape units are usually provided with cache memories. Such a cache memory is shown in FIG. 1 by block TM (Tape Memory). When the tape unit TU has received a data block from the computer CPU, it supplies a signal to the computer CPU, acknowledging the reception of the block. The computer may then search a disk unit W1, W2 for the next block. The computer, however, cannot be absolutely certain that the block has really been written onto the tape.
A problem arises when for some reason, the transfer of data from the tape memory TM onto the tape TA has not been successful. There may a weak point in the tape, or some other temporary malfunction may interfere with the storing process. In that case, the tape unit will notice, after a period of time, that the storing has failed. Even if the tape unit TU then sent the computer CPU an appropriate error message, the computer CPU would not know which blocks have been stored successfully and which have not. In prior art solutions, the whole storing process must then be repeated, which waste time. In addition, it should be possible to tell the data transmitting applications in computers CPU and CPUxe2x80x2 that the storing will have to be re-started from the beginning. This may sometimes require a change in the applications of different computers. In backup copying, for example, the whole content of the disk units is not always copied but only the areas that have changed since the last backup copy. A problem that may then arise is that a data-transmitting application has marked the areas as backup copied areas. If such a partial backup copying process were repeated, it would no longer be possible to know which areas have changed since the last backup copy. Correspondingly, when a tape unit is used, for example, for transferring billing information, the data-transmitting program may have marked the information as having been sent, and so it may not be possible to send the same information again.
European Patent Application 0,096,456 teaches a tape unit comprising a cache memory. If the unit malfunctions, the data contained in the cache memory can be rewritten onto the tape. In real time systems however, there is not sufficient protection, for example, in a situation where the tape unit Itself or the cache memory of the unit is damaged.
The object of the invention is to provide a method and an apparatus for implementing a method and apparatus for storing data in a tape unit having a cache memory, and a method and apparatus for reading data stored in accordance with the present invention. As a result the above problems concerning reliability and wasted time are eliminated. Currently preferred embodiments are presented in the dependent claims.
Since so much data to be stored is buffered in a ring buffer external to the tape unit for so long, one can be sure that the storing on the tape has been successfully completed.
The advantage of the method and system according to the invention is that the storing becomes more reliable and less time is wasted. Another advantage is that the process according to the invention is largely transparent to the data-transmitting computers and the applications operating in them. Few or no changes at all are thus needed in the application.